#include <stdio.h>
//计算1+1/2+。。。+1/100
float FenshuAdd(){
    int i=1;
    float sum=0;
    while(i<=100){
        float j=1/(float )i;
        sum+=j;
        ++i;
    }
    /*for(i=1;i<=100;++i){
        float j = 1/(float)i;
        printf("j=%f\n",j);
        sum+=j;
       //printf("sum=%.mf\n",sum);
    }*/

    return sum;
}
int main() {
    printf("1+1/2+..+1/100=%f\n",FenshuAdd());
    return 0;
}
